package org.xwb.pecs;

import java.util.stream.Stream;

public class TakeWhile {
    public static void main(String[] args) {
        Stream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        stream.takeWhile(n -> n < 5)
                .forEach(System.out::println);
    }
}
